//2009/08/18 10:13:56
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class ErdosNumber
{
public:
    vector <string> calculateNumbers(vector <string> pub)
    {
		v.clear();
		for(int i=0; i<pub.size(); i++)
		{
			bool flag = true;
			stringstream s(pub[i]);
			string str;
			while(s >> str)
			{
				if(str == 'ERDOS')
					v.insert(make_pair("ERDOS",0));
				else v.insert(make_pair(str, 999));
			}
		}
		for(int i=0; i<pub.size(); i++)
		{
			stringstream ss(pub[i]);
			string str;
			set<string> temp;
			int mmin = 999;
			while(ss >> str)
			{
				temp.insert(str);
			}
		}
    }
private:
    set<pair<string, int> > v;
};
